<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html><html lang="zh-CN"><head>
<meta charset="utf-8"/>
<meta name="renderer" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta content="${fns:getConfig('productName')}" name="description"/>
<meta content="http://www.ecode.net.cn" name="author"/>
<title>${fns:getConfig('productName')}</title>
<script src="${ctxStatic}/jquery/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/jquery/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="${ctxStaticTheme}/css/bootstrap.min.css?${_version}" />
<link rel="stylesheet" href="${ctxStaticTheme}/css/ace-fonts.min.css?${_version}" />
<link rel="stylesheet" href="${ctxStaticTheme}/css/ace.min.css?${_version}" class="ace-main-stylesheet" id="main-ace-style" />
<!--[if lte IE 9]><link rel="stylesheet" href="${ctxStaticTheme}/css/ace-part2.min.css?${_version}" class="ace-main-stylesheet" />
<link rel="stylesheet" href="${ctxStaticTheme}/css/ace-ie.min.css?${_version}" /><![endif]-->
<script src="${ctxStaticTheme}/js/ace-extra.min.js?${_version}"></script>
<link href="${ctxStatic}/wdScrollTab/css/bootstrap/TabPanel.css?${_version}" rel="stylesheet" type="text/css" />
<link href="${ctxStatic}/fonts/fonts-common.min.css?${_version}" rel="stylesheet" type="text/css"/>
<link href="${ctxStatic}/jquery-toastr/2.0/toastr.min.css?${_version}" rel="stylesheet" type="text/css"/>
<link href="${ctxStatic}/jquery-jbox/2.3/Skins/Bootstrap/jbox.css?${_version}" rel="stylesheet" type="text/css"/>
<link href="${ctxStatic}/common/jeesite.min.css?${_version}" type="text/css" rel="stylesheet"/>
<!--[if lte IE 8]><script src="${ctxStaticTheme}/js/html5shiv.min.js"></script>
<script src="${ctxStaticTheme}/js/respond.min.js"></script><![endif]-->
</head>
<body class="no-skin">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default navbar-fixed-top navbar-collapse">
	<script type="text/javascript">
		try{ace.settings.check('navbar' , 'fixed')}catch(e){}
	</script>
	
	<div class="navbar-container" id="navbar-container">
		
		<!-- #section:basics/navbar.toggle -->
		<button id="navbar-toggler" class="pull-right navbar-toggle navbar-toggle-img collapsed" type="button" 
				data-toggle="collapse" data-target=".navbar-buttons,.navbar-menu">
			<span class="sr-only">弹出菜单</span>
			<c:set var="user" value="${fns:getUser()}"/>
			<c:if test="${not empty user.photo}">
				<img class="nav-user-photo" src="${user.photo}" alt="${user.userName}"/>
			</c:if><c:if test="${empty user.photo}">
				<img class="nav-user-photo" src="${ctxStatic}/images/userinfo.jpg" alt="${user.userName}"/>
			</c:if>
		</button>
		
		<!-- #section:basics/sidebar.mobile.toggle -->
		<button id="menu-toggler" class="navbar-toggle menu-toggler pull-left" type="button"
				data-target="#sidebar">
			<span class="sr-only">侧边栏菜单</span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
		</button>
	
		<!-- /section:basics/sidebar.mobile.toggle -->
		<div class="navbar-header pull-left" style="min-width:179px;">
			<!-- #section:basics/navbar.layout.brand -->
			<a href="#" class="navbar-brand">
				<small>
					<i class="fa fa-leaf"></i>
					${fns:getConfig('productName')}
				</small>
			</a>
		</div>
		
		<%@ include file="/WEB-INF/views/themes/ace/include/topMenu.jsp"%>
		
	</div><!-- /.navbar-container -->
	
</div>

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
	<script type="text/javascript">
		try{ace.settings.check('main-container' , 'fixed')}catch(e){}
	</script>

	<%@ include file="/WEB-INF/views/themes/ace/include/leftMenu.jsp"%>
	
	<div class="main-content">
		<div id="tabpanel"></div>
	
		<%--<div class="main-content-inner">
			<!-- #section:basics/content.breadcrumbs -->
			<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
				<script type="text/javascript">
					try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
				</script>

				<ul class="breadcrumb">
					<li>
						<i class="ace-icon fa fa-home home-icon"></i>
						<a href="#">Home</a>
					</li>
				</ul><!-- /.breadcrumb -->

				<!-- #section:basics/content.searchbox -->
				<div class="nav-search" id="nav-search">
					<form class="form-search">
						<span class="input-icon">
							<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
							<i class="ace-icon fa fa-search nav-search-icon"></i>
						</span>
					</form>
				</div><!-- /.nav-search -->

				<!-- /section:basics/content.searchbox -->
			</div>

			<!-- /section:basics/content.breadcrumbs -->
			<div class="page-content">
				<!-- #section:settings.box -->
				<div class="ace-settings-container" id="ace-settings-container">
					<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
						<i class="ace-icon fa fa-cog bigger-130"></i>
					</div>

					<div class="ace-settings-box clearfix" id="ace-settings-box">
						<div class="pull-left width-50">
							<!-- #section:settings.skins -->
							<div class="ace-settings-item">
								<div class="pull-left">
									<select id="skin-colorpicker" class="hide">
										<option data-skin="no-skin" value="#438EB9">#438EB9</option>
										<option data-skin="skin-1" value="#222A2D">#222A2D</option>
										<option data-skin="skin-2" value="#C6487E">#C6487E</option>
										<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
									</select>
								</div>
								<span>&nbsp; Choose Skin</span>
							</div>

							<!-- /section:settings.skins -->

							<!-- #section:settings.navbar -->
							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" />
								<label class="lbl" for="ace-settings-navbar"> Fixed Navbar</label>
							</div>

							<!-- /section:settings.navbar -->

							<!-- #section:settings.sidebar -->
							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" />
								<label class="lbl" for="ace-settings-sidebar"> Fixed Sidebar</label>
							</div>

							<!-- /section:settings.sidebar -->

							<!-- #section:settings.breadcrumbs -->
							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs" />
								<label class="lbl" for="ace-settings-breadcrumbs"> Fixed Breadcrumbs</label>
							</div>

							<!-- /section:settings.breadcrumbs -->

							<!-- #section:settings.rtl -->
							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl" />
								<label class="lbl" for="ace-settings-rtl"> Right To Left (rtl)</label>
							</div>

							<!-- /section:settings.rtl -->

							<!-- #section:settings.container -->
							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
								<label class="lbl" for="ace-settings-add-container">
									Inside
									<b>.container</b>
								</label>
							</div>

							<!-- /section:settings.container -->
						</div><!-- /.pull-left -->

						<div class="pull-left width-50">
							<!-- #section:basics/sidebar.options -->
							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-hover" />
								<label class="lbl" for="ace-settings-hover"> Submenu on Hover</label>
							</div>

							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-compact" />
								<label class="lbl" for="ace-settings-compact"> Compact Sidebar</label>
							</div>

							<div class="ace-settings-item">
								<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-highlight" />
								<label class="lbl" for="ace-settings-highlight"> Alt. Active Item</label>
							</div>

							<!-- /section:basics/sidebar.options -->
						</div><!-- /.pull-left -->
					</div><!-- /.ace-settings-box -->
				</div><!-- /.ace-settings-container -->
				<!-- /section:settings.box -->
				<div class="page-content-area" data-ajax-content="true">
					<!-- ajax content goes here -->
				</div><!-- /.page-content-area -->
			</div><!-- /.page-content -->
		</div> --%>
	</div><!-- /.main-content -->

	<%--<div class="footer">
		<div class="footer-inner">
			<!-- #section:basics/footer -->
			<div class="footer-content">
				<span class="bigger-120">
					Copyright &copy; 2012-${fns:getConfig('copyrightYear')}&nbsp;${fns:getConfig('productName')}
				</span>

				&nbsp; &nbsp;
				<span class="action-buttons">
					<a href="#">
						<i class="ace-icon fa fa-twitter-square light-blue bigger-150"></i>
					</a>

					<a href="#">
						<i class="ace-icon fa fa-facebook-square text-primary bigger-150"></i>
					</a>

					<a href="#">
						<i class="ace-icon fa fa-rss-square orange bigger-150"></i>
					</a>
				</span>
			</div>

			<!-- /section:basics/footer -->
		</div>
	</div>

	<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
		<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
	</a> --%>
</div><!-- /.main-container -->
<!-- basic scripts -->
<%-- <script type="text/javascript">
	if('ontouchstart' in document.documentElement)
		document.write("<script src='${ctxStaticTheme}/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
</script> --%>
<script src="${ctxStaticTheme}/js/bootstrap.min.js?${_version}"></script>
<script src="${ctxStaticTheme}/js/ace/elements.scroller.min.js?${_version}"></script>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.colorpicker.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.fileinput.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.typeahead.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.wysiwyg.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.spinner.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.treeview.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.wizard.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/elements.aside.min.js?${_version}"></script> --%>
<script src="${ctxStaticTheme}/js/ace/ace.min.js?${_version}"></script>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.ajax-content.min.js?${_version}"></script> --%>
<script src="${ctxStaticTheme}/js/ace/ace.touch-drag.min.js?${_version}"></script>
<script src="${ctxStaticTheme}/js/ace/ace.sidebar.min.js?${_version}"></script>
<script src="${ctxStaticTheme}/js/ace/ace.sidebar-scroll-2.min.js?${_version}"></script>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.submenu-hover.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.widget-box.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.settings.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.settings-rtl.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.settings-skin.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.widget-on-reload.min.js?${_version}"></script> --%>
<%-- <script src="${ctxStaticTheme}/js/ace/ace.searchbox-autocomplete.min.js?${_version}"></script> --%>
<script src="${ctxStatic}/wdScrollTab/js/TabPanel.min.js?${_version}" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-toastr/2.0/toastr.min.js?${_version}" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-jbox/2.3/jquery.jBox-2.3.min.js?${_version}" type="text/javascript"></script>
<script src="${ctxStatic}/common/jeesite.min.js?${_version}" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function(){
		
		// 初始化页签
		$('#tabpanel').tabPanel({
			autoResizable: true,
			height: function () {
				return $(window).height() - $('#navbar').height();
			},
			items: []
		}).tabPanel('resize');

   		// 打开首页页签
		addTabPage(null, '<i class="ace-icon fa fa-home home-icon"'
			+'style="font-size:18px;vertical-align:middle;margin-top:-3px;"></i> 首页',
			'${ctx}${fns:getConfigDefault("sys.home.pageUrl", "/../desktop")}' , null, false, false);
   		
		// 绑定菜单按钮事件
		$(document).on('click', 'a.addTab', function (e) {

			// 设置侧边栏菜单选中
			if ($(this).parents('#sidebar').length > 0){
				$('#sidebar li').removeClass('open active');
				$(this).parents('li').addClass('active').parents('li').addClass('open');
			}
			
			// 重置侧边栏滚动条
 			$('#sidebar').ace_sidebar_scroll('reset');
			
			// 获取网页地址和标题
			var href = $(this).data("href");
			var title = $(this).data("title");
			
			// 打开页签页面
			addTabPage($(this), $.trim(title || $(this).text()), href || 'blank', null, true, false);
			window.location.hash = (href || 'blank').replace('#', '');
			//<c:if test="${fns:getConfig('sys.home.menuStyle') eq '2'}">
			cookie('currentMenuId', $(".navbar-menu li.open a.menu").data("id"));// 保存当前一级菜单ID
			//</c:if>
			
			// 如果小窗口下，则选择菜单后，则折叠菜单
			$('#menu-toggler.display:visible').click();
		});
		
		//<c:if test="${fns:getConfig('sys.home.menuStyle') eq '2'}">
		// 绑定水平菜单单击事件
		$(".navbar-menu a.menu").click(function(){
			// 一级菜单焦点
			$('.navbar-menu li').removeClass('open');
			$(this).parents('li').addClass('open');
			// 显示二级菜单
			var menuId = "#menu-" + $(this).data("id");
			if ($(menuId).length > 0){
				$("#sidebar .sidebar-menu > ul").hide();
				$(menuId).show();	
			}else{
				// 获取二级菜单数据
				$.ajax({type: "get", url: $(this).attr("data-href"),
					async: false, success: function(data){
						$("#sidebar .sidebar-menu > ul").hide();
						$("#sidebar .sidebar-menu").append(data);
					}
				});
			}
			// 如果小窗口下，点击一级菜单后，显示二级菜单
			if ($('.navbar-menu').hasClass("in")){
				$('#navbar-toggler:visible').click();
				$('#menu-toggler:visible:not(.display)').click();
			}
			// 重置侧边栏滚动条
			$('#sidebar').ace_sidebar_scroll('reset');
			return false;
		});
		// 刷新页面后激活上次的菜单状态位置
		var currentMenuId = cookie('currentMenuId');
		if (currentMenuId && currentMenuId != ''){
			var currentMenu = $(".navbar-menu a.menu[data-id="+currentMenuId+"]");
			if (currentMenu.length > 0){
				currentMenu.click();
			}else{
				currentMenuId = "-1";
			}
		}else{
			currentMenuId = "-1";
		}
		if (currentMenuId == "-1"){
			// 默认加载第一个一级菜单的二级菜单
			$(".navbar-menu a.menu:first").click(); 
		}
		//</c:if>
		
		//<c:if test="${fns:getConfig('sys.home.defaultSidebarClosed') eq 'true'}">
		// 默认折叠左侧菜单
		if (!$("#sidebar").hasClass("menu-min")){
			$("#sidebar-collapse").click();
		}
		//</c:if>
       	
		// 绑定hash更改事件，刷新打开指定页面的页签。
		$(window).bind("hashchange", function(e) {
			var hash = window.location.hash.replace('#', '');
			var addTab = $('a[data-href="' + hash + '"]:eq(0)');
			if (hash && hash != ''){
				if(addTab && addTab.length > 0){
					addTab.click();
				}else{
					addTabPage(null, '新建页签', hash);
				}
			}else{
				//$('.page-sidebar-menu .sub-menu .addTab :eq(0)').click(); // 默认展开第一个菜单
			}
		}).trigger("hashchange");
        
		// 初始密码提示
		if ('${isInitPassword}' == 'true'){
			confirmx("您的密码还是初始密码，请修改密码！", function(){
				$('#modifyPassword').click();
			});
		}

   		// IE8下窗口修正
		setTimeout(function(){
			$(window).resize();
		},100); 
	});
       
	/**
	 * 添加TAB页面
	 * @param $this 		点击的对象
	 * @param title 		提示标题
	 * @param url   		访问的路径
	 * @param parentTabPageId 来源页面ID（废弃参数）
	 * @param closeable	 	是否有关闭按钮
	 * @param refresh 		打开后是否刷新重新加载
	 */
	function addTabPage($this, title, url, parentTabPageId, closeable, refresh){
		var tabId = $this ? $this.data('tabId') : null;
		if (tabId == undefined){
			tabId = 'tabpanel-' + Math.uuid();
			$this ? $this.attr('data-tab-id', tabId) : null;
		}
		$('#tabpanel').tabPanel('addTab', {
			id: tabId,
			title: title,
			html: '<scr'+'ipt>loading();</scr'+'ipt><iframe id="'+tabId+'-frame" src="' + url 
				+ '" width="100%" height="100%" frameborder="0" onload="closeLoading();"></iframe>',
			closable: (closeable == undefined ? true : closeable),
			disabled: false
		});
	}

	/**
	 * 关闭当前TAB页面，并激活上级页面
	 * @param parentTabPageId 上级界面ID（废弃参数）
	 * @param callback(contents, contentWindow)	关闭时的回调方法，传入上级页面的contents和contentWindow
	 */
	function closeCurrentTabPage(parentTabPageId, preTabCallback){
		var actTab = $('#tabpanel').tabPanel('getActiveTab');
		var preTab = $('#' + actTab.preTabId + '-frame');
		if (preTab.length > 0){
			var contents = preTab.contents();
			var contentWindow = preTab[0].contentWindow;
			if (typeof preTabCallback == 'function'){
				try{
					preTabCallback(contents, contentWindow);
				}catch(e){
       				log(e);
				}
			}
		}
		$('#tabpanel').tabPanel('kill', actTab.id);
	}
</script>
<c:if test="${fns:getModule('msg').isEnable}">
	<!-- Message JS -->
	<script src="${ctxPath}/dwr/engine.js?${_version}" type="text/javascript"></script>
	<script src="${ctxPath}/dwr/util.js?${_version}" type="text/javascript"></script>
	<script src="${ctxPath}/dwr/interface/MsgPushService.js?${_version}" type="text/javascript"></script>
	<script src="${ctxStatic}/jquery-plugin/jquery-timeago-1.4.1.min.js?${_version}" type="text/javascript"></script>
	<script src="${ctxStatic}/common/msgPush.js?${_version}" type="text/javascript"></script>
	<script type="text/template" id="msgTipTpl">
		<abbr class="timeago" title="{{time}}">{{time}}</abbr> 来自 {{message.senderName}} <br/> {{&message.contentTitle}} 
		<div style="margin:5px 0 2px;float:right;">
			<button class="btn btn-white btn-primary btn-sm" type="button" data-href="${ctx}/msg/message/view?mrId={{id}}"
				onclick="readMsg(this, '消息详情', '{{id}}')">查看</button>&nbsp;
			{{#buttonList}}
				<button class="btn btn-white btn-primary btn-sm" type="button" data-href="${ctx}{{href}}"
					 onclick="readMsg(this, '消息{{name}}', '{{id}}');">{{name}}</button>&nbsp;
			{{/buttonList}}
		</div>
	</script>
	<script type="text/template" id="msgListTpl">
		<li id="msg{{id}}">
			<a href="javascript:" data-href="${ctx}/msg/message/view?mrId={{id}}" onclick="readMsg(this, '消息详情', '{{id}}')" >
				<div class="clearfix">
					<span class="pull-left"><i class="btn btn-xs no-hover btn-pink fa fa-comment"></i> {{&message.contentTitle}}</span>
					<span class="pull-right"><abbr class="timeago" title="{{time}}">{{time}}</abbr></span>
				</div>
			</a>
		</li>
	</script>
</c:if>
</body>
</html>